﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ARS.Control.Custom.Entity.Fields;

namespace NetWebControl.ControlTest
{

    public class Model
    {
        [KeyField()]
        public int Id
        {
            get;
            set;
        }

        public string Name
        {
            get;
            set;
        }

    
    }

    public partial class Mapped : System.Web.UI.Page
    {
        Model model = new Model();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.EntityMappingPanel1.Entity = model;
            if (!IsPostBack)
            {
                
                model.Name = "111";
                
                //            this.EntityMappingPanel1.
                this.EntityMappingPanel1.EntityToControl();
            }


        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            this.EntityMappingPanel1.ControlToEntity();
            Response.Write(model.Name);
        }
    }
}